package com.ruoyi.app.controller;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.partner.domain.CmsPartner;
import com.ruoyi.partner.service.ICmsPartnerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 合作伙伴Controller
 * 
 * @author hct
 * @date 2022-02-16
 */
@RestController
@RequestMapping("/app/public/partner")
public class AppPartnerController extends BaseController
{
    @Autowired
    private ICmsPartnerService cmsPartnerService;
    /**
     * 查询合作伙伴列表
     */
    @GetMapping("/index")
    public TableDataInfo index(CmsPartner cmsPartner)
    {
        startPage();
        List<CmsPartner> list = cmsPartnerService.selectCmsPartnerList(cmsPartner);
        return getDataTable(list);
    }
    /**
     * 查询合作伙伴列表
     */
    @GetMapping("/list")
    public TableDataInfo list(CmsPartner cmsPartner)
    {
        startPage();
        List<CmsPartner> list = cmsPartnerService.selectCmsPartnerList(cmsPartner);
        return getDataTable(list);
    }

    /**
     * 获取合作伙伴详细信息
     */
    @GetMapping(value = "/detail/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(cmsPartnerService.selectCmsPartnerById(id));
    }

}
